class PayBean {
  int code;
  int subCode;
  String msg;
  String msgCn;
  double processTime;
  int takeNo;
  List<Products> products;
  int seq;
  String createDate;
  String amt;
  String amtDues;
  Table table;
  String rebate;
  int account;
  String balance;
  String credit;
  String credited;
  String reward;
  String freeze;
  String rewardCurrent;
  String balanceUsable;
  String totalConsum;
  Expand expand;
  List<Payment> payment;
  List<Payment2> payment2;
  String prices;
  int codeAll;
  String card;

  PayBean(
      {this.code,
      this.subCode,
      this.msg,
      this.msgCn,
      this.processTime,
      this.takeNo,
      this.products,
      this.seq,
      this.createDate,
      this.amt,
      this.amtDues,
      this.table,
      this.rebate,
      this.account,
      this.balance,
      this.credit,
      this.credited,
      this.reward,
      this.freeze,
      this.rewardCurrent,
      this.balanceUsable,
      this.totalConsum,
      this.expand,
      this.payment,
      this.payment2,
      this.prices,
      this.codeAll});

  PayBean.fromJson(Map<String, dynamic> json) {
    code = json['code'];
    subCode = json['sub_code'];
    msg = json['msg'];
    msgCn = json['msg_cn'];
    processTime = json['process_time'];
    takeNo = json['take_no'];
    if (json['products'] != null) {
      products = new List<Products>();
      json['products'].forEach((v) {
        products.add(new Products.fromJson(v));
      });
    }
    seq = json['seq'];
    createDate = json['create_date'];
    amt = json['amt'];
    amtDues = json['amt_dues'];
    table = json['table'] != null ? new Table.fromJson(json['table']) : null;
    rebate = json['rebate'];
    account = json['account'];
    balance = json['balance'];
    credit = json['credit'];
    credited = json['credited'];
    reward = json['reward'];
    freeze = json['freeze'];
    rewardCurrent = json['reward_current'];
    balanceUsable = json['balance_usable'];
    totalConsum = json['total_consum'];
    expand =
        json['expand'] != null ? new Expand.fromJson(json['expand']) : null;
    if (json['payment'] != null) {
      payment = new List<Payment>();
      json['payment'].forEach((v) {
        payment.add(new Payment.fromJson(v));
      });
    }
    if (json['payment2'] != null) {
      payment2 = new List<Payment2>();
      json['payment2'].forEach((v) {
        payment2.add(new Payment2.fromJson(v));
      });
    }
    prices = json['prices'];
    codeAll = json['code_all'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    data['sub_code'] = this.subCode;
    data['msg'] = this.msg;
    data['msg_cn'] = this.msgCn;
    data['process_time'] = this.processTime;
    data['take_no'] = this.takeNo;
    if (this.products != null) {
      data['products'] = this.products.map((v) => v.toJson()).toList();
    }
    data['seq'] = this.seq;
    data['create_date'] = this.createDate;
    data['amt'] = this.amt;
    data['amt_dues'] = this.amtDues;
    if (this.table != null) {
      data['table'] = this.table.toJson();
    }
    data['rebate'] = this.rebate;
    data['account'] = this.account;
    data['balance'] = this.balance;
    data['credit'] = this.credit;
    data['credited'] = this.credited;
    data['reward'] = this.reward;
    data['freeze'] = this.freeze;
    data['reward_current'] = this.rewardCurrent;
    data['balance_usable'] = this.balanceUsable;
    data['total_consum'] = this.totalConsum;
    if (this.expand != null) {
      data['expand'] = this.expand.toJson();
    }
    if (this.payment != null) {
      data['payment'] = this.payment.map((v) => v.toJson()).toList();
    }
    if (this.payment2 != null) {
      data['payment2'] = this.payment2.map((v) => v.toJson()).toList();
    }
    data['prices'] = this.prices;
    data['code_all'] = this.codeAll;
    return data;
  }
}

class Products {
  String id;
  String name;
  int type;
  int price;
  int weight;
  String amt;

  Products({this.id, this.name, this.type, this.price, this.weight, this.amt});

  Products.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    type = json['type'];
    price = json['price'];
    weight = json['weight'];
    amt = json['amt'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['type'] = this.type;
    data['price'] = this.price;
    data['weight'] = this.weight;
    data['amt'] = this.amt;
    return data;
  }
}

class Table {
  String no;

  Table({this.no});

  Table.fromJson(Map<String, dynamic> json) {
    no = json['no'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['no'] = this.no;
    return data;
  }
}

class Expand {
  String tomonth;
  String tomonthCharge;
  String tomonthChargeGift;
  String tomonthChargeCount;
  String tomonthConsum;
  String tomonthConsumCount;
  String totalCharge;
  String totalChargeCount;
  String lastChargeDate;
  int lastChargeAmt;
  String totalConsum;
  String totalConsumCount;
  String today;
  String  todayCount;
  String lastConsumDate;
  int lastConsumAmt;
  String todayConsum;
  String totalChargeGift;
  String mobilePay;

  Expand(
      {this.tomonth,
      this.tomonthCharge,
      this.tomonthChargeGift,
      this.tomonthChargeCount,
      this.tomonthConsum,
      this.tomonthConsumCount,
      this.totalCharge,
      this.totalChargeCount,
      this.lastChargeDate,
      this.lastChargeAmt,
      this.totalConsum,
      this.totalConsumCount,
      this.today,
      this.todayCount,
      this.lastConsumDate,
      this.lastConsumAmt,
      this.todayConsum,
      this.totalChargeGift,
      this.mobilePay});

  Expand.fromJson(Map<String, dynamic> json) {
    tomonth = json['tomonth'];
    tomonthCharge = json['tomonth_charge'];
    tomonthChargeGift = json['tomonth_charge_gift'];
    tomonthChargeCount = json['tomonth_charge_count'];
    tomonthConsum = json['tomonth_consum'];
    tomonthConsumCount = json['tomonth_consum_count'];
    totalCharge = json['total_charge'];
    totalChargeCount = json['total_charge_count'];
    lastChargeDate = json['last_charge_date'];
    lastChargeAmt = json['last_charge_amt'];
    totalConsum = json['total_consum'];
    totalConsumCount = json['total_consum_count'];
    today = json['today'];
    todayCount = json['today_count'];
    lastConsumDate = json['last_consum_date'];
    lastConsumAmt = json['last_consum_amt'];
    todayConsum = json['today_consum'];
    totalChargeGift = json['total_charge_gift'];
    mobilePay = json['mobile_pay'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['tomonth'] = this.tomonth;
    data['tomonth_charge'] = this.tomonthCharge;
    data['tomonth_charge_gift'] = this.tomonthChargeGift;
    data['tomonth_charge_count'] = this.tomonthChargeCount;
    data['tomonth_consum'] = this.tomonthConsum;
    data['tomonth_consum_count'] = this.tomonthConsumCount;
    data['total_charge'] = this.totalCharge;
    data['total_charge_count'] = this.totalChargeCount;
    data['last_charge_date'] = this.lastChargeDate;
    data['last_charge_amt'] = this.lastChargeAmt;
    data['total_consum'] = this.totalConsum;
    data['total_consum_count'] = this.totalConsumCount;
    data['today'] = this.today;
    data['today_count'] = this.todayCount;
    data['last_consum_date'] = this.lastConsumDate;
    data['last_consum_amt'] = this.lastConsumAmt;
    data['today_consum'] = this.todayConsum;
    data['total_charge_gift'] = this.totalChargeGift;
    data['mobile_pay'] = this.mobilePay;
    return data;
  }
}

class Payment {
  int type;
  String amt;
  String bal;
  int account;

  Payment({this.type, this.amt, this.bal, this.account});

  Payment.fromJson(Map<String, dynamic> json) {
    type = json['type'];
    amt = json['amt'];
    bal = json['bal'];
    account = json['account'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['type'] = this.type;
    data['amt'] = this.amt;
    data['bal'] = this.bal;
    data['account'] = this.account;
    return data;
  }
}

class Payment2 {
  int type;
  String amt;
  String bal;
  int account;
  int ispay;

  Payment2({this.type, this.amt, this.bal, this.account, this.ispay});

  Payment2.fromJson(Map<String, dynamic> json) {
    type = json['type'];
    amt = json['amt'];
    bal = json['bal'];
    account = json['account'];
    ispay = json['ispay'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['type'] = this.type;
    data['amt'] = this.amt;
    data['bal'] = this.bal;
    data['account'] = this.account;
    data['ispay'] = this.ispay;
    return data;
  }
}
